<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var obj1 = {
            name : 'xiaopanpan',
            age : 20,
            fn1: function(){
                document.write('西瓜')
            }
        }
        var obj = new Object();
        obj.name = 'xiaoma';
        obj.age = 21;
        obj.fn1 = function(){
            document.write('车厘子')
        }

        for (var i in obj){
            document.write(obj1[i]+'<br>')
        }    
        document.write(obj.name);
        console.log(obj["age"]);
        obj.fn1();
    </script>
</body>
</html>